<!--eslint-disable-->
<template>
  <div class="home">
    <header>
      <search></search>
    </header>
    <section> 	 
      <swiper heights='10' :swiperList='swiperList' :direction='direction'></swiper> <!--轮播图-->   		
      <letters></letters>	<!-- 新华都快报 -->		
      <fourAdvertising ></fourAdvertising>   	 <!--正方形广告区-->       
      <RectangularAdvertising> </RectangularAdvertising> <!--长方形广告区-->     
      <bottomGoods ref='bottomGoods'></bottomGoods>   <!--热销商品-->
    </section>
    <footer>
      <foot></foot>
    </footer>
  </div>
</template>

<style lang="less" scoped>
@import '~vux/src/styles/1px.less';
header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
}
section {
	overflow: hidden;
  margin-top: 2.6rem;
}
</style>
<script>
import Search from '@/components/search.vue'
import Swiper from '@/components/swiper.vue'
import Letters from '@/components/letters.vue'
import AdvertisingTop from '@/components/advertisingTop.vue'
import FourAdvertising from '@/components/fourAdvertising.vue'
import RectangularAdvertising from '@/components/rectangularAdvertising.vue'
import BottomGoods from '@/components/bottomGoods.vue'
import Foot from '@/components/footer.vue'


export default {
  components: {
    Swiper,
    Search,
    AdvertisingTop,
    Letters,
    FourAdvertising,
    RectangularAdvertising,
    BottomGoods,
    Foot
  },
  data () {
    return {
      swiperList: [],
      bottomCount: 20,
      mes: '购物需知，买家必看',
      results: [],
      place: '福州',
      direction: 'right'
    }
  },
  methods: {
    turnTo: function () {
      this.$router.push('/conment/3')
    },
    demo01_onIndexChange (index) {
      this.demo01_index = index
    },
    onScrollBottom () {
      if (this.onFetching) {
        // do nothing
      } else {
        this.onFetching = true
        setTimeout(() => {
          this.bottomCount += 10
          this.$nextTick(() => {
            this.$refs.scrollerBottom.reset()
          })
          this.onFetching = false
        }, 1500)
      }
    },
    switchs (val) {
      this.bottomCount = val
      this.$nextTick(() => {
        this.$refs.scrollerBottom.reset({
          top: 0
        })
      })
    },
    resultClick (item) {
      window.alert('you click the result item: ' + JSON.stringify(item))
    },
    getResult (val) {},
    onSubmit () {
      this.$refs.search.setBlur()
      this.$vux.toast.show({})
      this.$vux.toast.show({
      })
    },
    onFocus () {
      this.place = ''
    },
    onCancel () {
      this.place = '福州'
    }
  }
}
</script>
